package org.dyz.banana.platform.util.common;

import java.util.Random;

public class RandomUtil {

    public int getRandomFromRange(int start,int end) throws Exception{
        if(start>end)
            throw new Exception("end number should be smaller than start number!");
       return new Random().nextInt(end-start)+start;
    }

    public static void main(String[] args) {
        try {
            System.out.println(new RandomUtil().getRandomFromRange(0,5));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
